Skip to content

feat(datasource): mars-style date matching#168

Merged
peshence merged 14 commits intomainfrom
feat/mars-style-date-matching
Mar 16, 2026
Merged

feat(datasource): mars-style date matching#168
peshence merged 14 commits intomainfrom
feat/mars-style-date-matching

Conversation

@peshence
Copy link
Collaborator

@peshence peshence commented Mar 10, 2026

Description

Add the ability to set date match rules with mars date strings (lists, ranges without "by"), e.g.

date: ["-1/to/-20", "-30/to/-40"]

Where the request dates must match one of the rule strings. Ranges in requests can only match ranges in rules (to avoid having to expand the whole range)

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for “MARS-style” date rule strings in datasource match.date configuration (single/list/range/stepped-range), alongside existing old-style relative comparisons.

Changes:

  • Implement MARS date token parsing plus list/range(/by step) expansion and matching logic in date_check.
  • Add unit tests covering token parsing, expansion, rule matching, and date_check OR/AND semantics.
  • Update the documented JSON schema descriptions/examples for date matching rules.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
polytope_server/common/datasource/date_check.py Adds MARS-style parsing/expansion/matching and updates date_check logic to support OR-matching across multiple MARS rules.
tests/unit/test_date_check.py New unit test suite for MARS-style date parsing/matching and old-style compatibility.
docs/source/schemas/schema.json Updates match/date documentation and expands schema typing for match values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

peshence and others added 4 commits March 16, 2026 09:08
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@peshence peshence merged commit eef9269 into main Mar 16, 2026
5 checks passed
@peshence peshence deleted the feat/mars-style-date-matching branch March 16, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants